﻿using System;
using System.Collections;
using System.Collections.Generic;
using THEDARKKNIGHT.UI;
using UnityEngine;

public class MainWindows : BBaseWindows
{

    private GameObject ReUIRoot;

    public MainWindows(string windowsName) {
        WindowsAlias = windowsName;
    }


    public override void AddListener()
    {
        
    }

    public override void DataInit()
    {
        ReUIRoot = Resources.Load<GameObject>("UIPrefabs/Canvas");
        DeviceListWindows deviceWindows = new DeviceListWindows("DeviceListPanel");
        VideoListWindows  videoListWindows = new VideoListWindows("VideoListPanel");
        PlayWindows playWindows = new PlayWindows("PlayWindows");
        RegisterWindows(deviceWindows.WindowsAlias, deviceWindows);
        RegisterWindows(videoListWindows.WindowsAlias, videoListWindows);
        RegisterWindows(playWindows.WindowsAlias, playWindows);
    }

    public override void DestoryWindows()
    {
        ReUIRoot = null;
        GC.Collect();
    }

    public override bool GetWindowsMsg(int windowsID, string windowsAlias, object data)
    {
        return true;
    }

    public override void Hide()
    {
        
    }

    public override void RemoveListener()
    {
        
    }

    public override void Show()
    {
        
    }

    public override Transform UIInit(Transform UIRoot)
    {
        GameObject MainUIRoot = GameObject.Instantiate(ReUIRoot);
        return MainUIRoot.transform;
    }
}
